package client.comm.baoding.ui.vm

import android.app.Application
import androidx.lifecycle.MutableLiveData
import client.comm.baoding.api.bean.HangOrderRecord
import client.comm.baoding.api.bean.Zcjl
import client.comm.baoding.ui.viewmodel.MiddleVm
import client.comm.commlib.network.data.JsonResult
import client.comm.commlib.network.data.Ret


class GuadanViewModel(app: Application) : MiddleVm(app) {
    val isShowing = MutableLiveData<Boolean>(false)

    val isOneLoading = MutableLiveData<Boolean>(false)
    val pageOne = MutableLiveData<Int>(0)
    val callOne = MutableLiveData<JsonResult<Zcjl>>()
    val cancelRet = MutableLiveData<JsonResult<Ret>>()
    val queRenRet = MutableLiveData<JsonResult<Ret>>()

    val newQueRenRet = MutableLiveData<JsonResult<Ret>>()

//    fun querenOrder(b: ZrAndSgRet.Order) {
//        hold({
//            server.buyer_confirm(
//                "${b.order_id}"
//            )
//        }, {
//            isShowing.value = true
//        }, {
//            queRenRet.value = it
//        }, complete = {
//            isShowing.value = false
//
//        })
//    }
//

//    fun cancelOrder(b: HangOrderRecord.Order) {
//        if (isOneLoading.value!!)
//            return
//        hold({
//            server.trade_revoke_order("${b.id}")
//        }, {
//            isOneLoading.value = true
//            pageOne.value = pageOne.value!! + 1
//        }, {
//            cancelRet.value = it
//        }, complete = {
//            isOneLoading.value = false
//        })
//    }


}